package celiasoft.itasalib.structures;

import celiasoft.itasalib.query.resultparser.MalformedSubsVersionException;

public enum SubsVersion {

	NORMALE("Normale"),
	HDTV("HDTV"),
	BLURAY("Bluray"),
	BRRIP("BRRip"),
	HR("HR"),
	DVDRIP("DVDRip"),
	RESOLUTION720P("720p"),
	RESOLUTION1080P("1080p"),
	RESOLUTION1080I("1080i"),
	NONE("");
	
	@Override
	public String toString() {
		return this.getLabel();
	}
	

	private String _label;
	
	private SubsVersion(String label){
		this._label = label;
	}
	
	public String getLabel(){
		return this._label.toString();
	}

	public static SubsVersion parse(String strValue) throws MalformedSubsVersionException{
		
		for(SubsVersion v: SubsVersion.values()){
			if(v.getLabel().compareTo(strValue) == 0){
				return v;
			}
		}
		
		throw new MalformedSubsVersionException();
	}
}
